score_list = []
GPA_list = []
grade_list = []
score_sum = 0
grade_sum = 0
dic = {
    "A": 4.0,
    "A-": 3.7,
    "B+": 3.3,
    "B": 3.0,
    "B-": 2.7,
    "C+": 2.3,
    "C": 2.0,
    "C-": 1.5,
    "D": 1.3,
    "D-": 1,
    "F": 0,
}

while True:
    score = input("")
    if score != "-1":
        score_list.append(score)
    elif score == "-1":
        break

for item in score_list:
    try:
        grade_list.append(int(item))
    except:
        GPA_list.append(dic.get(item))

for i in range(len(grade_list)):
    score_sum += grade_list[i]*GPA_list[i]
    grade_sum += grade_list[i]

print("{:.2f}".format(score_sum/grade_sum))
